class MyArray<T> {
    //范类的使用
    public Object[] array = new Object[10];
    public void setValue(int pos,T val) {
        array[pos] = val;
    }
    public T getValue(int pos) {
        return (T) array[pos];
    }
}

public class Text {
    public static void main(String[] args) {
        MyArray<String> myArray = new MyArray<>();
        myArray.setValue(0,"hello");
        myArray.setValue(1,"world");
        myArray.setValue(2,"fu");
        String s = myArray.getValue(0);
        String s1 = myArray.getValue(1);
        String s2 = myArray.getValue(2);
        System.out.println(s+s1+s2);
        MyArray<Integer> myArray1 = new MyArray<>();
        myArray1.setValue(0,99);
        myArray1.setValue(1,20);
    }
}